package com.minjiang.dao.Impl;

import com.minjiang.dao.AccountMapper;
import com.minjiang.pojo.Account;
import org.mybatis.spring.SqlSessionTemplate;

public class AccountMapperDao implements AccountMapper {
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
    public int updateMoney(int id, float money) {
        AccountMapper mapper = sqlSession.getMapper(AccountMapper.class);
        int i = mapper.updateMoney(id, money);
        return i;
    }

    public Account queryUserById(String name) {
        AccountMapper mapper = sqlSession.getMapper(AccountMapper.class);
        Account account = mapper.queryUserById(name);
        return account;
    }
}
